﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using QuizAppMvc2.Bll;

namespace QuizAppMvc2.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        [Authorize]
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            return View();
        }

        [Authorize]
        public ActionResult About()
        {
            return View();
        }

        [Authorize]
        public ActionResult Input()
        {
            return View();
        }

        [Authorize]
        [HttpPost]
        public ActionResult Input(String collection)
        {
            string teste = Request.Params[1];

            
            Parser parser = new Parser();
            string[] lines = teste.Split('\n');
            ViewData["novas"] =  parser.GoParser(lines);
            ViewData["incluidas"] = parser.incluidas;

            return View("Import");
        }

    }
}
